import {FETCH_DASHBOARD, FETCH_NOTICES, LOGIN, REGISTER} from "./const";

const initState = {
  login: false,
  register: false,
  fetchNotices: false,
  fetchDashboard: false,
};

const keys = [LOGIN, REGISTER, FETCH_NOTICES, FETCH_DASHBOARD];

export default function reducer(state = initState, {type, payload}) {
  if (keys.includes(type)) return {...state, ...payload};
  else return state;

}
